<?php
namespace app\backend\controller;

use app\backend\model\UserModel;
class Index extends Base
{
    public function _initialize()
    {
        parent::_initialize();
        if(!(new UserModel())->checkLogin()){
            return $this->redirect($this->request->root() . '/');
        }
        $this->assign('user',session('user'));
    }

    public function index()
    {
        return $this->fetch();
    }

    public function welcome(){
        return $this->fetch();
    }
}
